<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ tag body-content="empty" %>

<%@ attribute name="unlocked" rtexprvalue="true" type="java.lang.Boolean" required="false" %>
<%@ attribute name="showLine" rtexprvalue="true" type="java.lang.Boolean" required="false" %>
<%@ attribute name="showBack" rtexprvalue="true" type="java.lang.Boolean" required="false" %>
<%@ attribute name="showReset" rtexprvalue="true" type="java.lang.Boolean" required="false" %>
<%@ attribute name="showNew" rtexprvalue="true" type="java.lang.Boolean" required="false" %>
<%@ attribute name="showDelete" rtexprvalue="true" type="java.lang.Boolean" required="false" %>
<%@ attribute name="showSave" rtexprvalue="true" type="java.lang.Boolean" required="false" %>
<%@ attribute name="showCancel" rtexprvalue="true" type="java.lang.Boolean" required="false" %>
<%@ attribute name="showPrint" rtexprvalue="true" type="java.lang.Boolean" required="false" %>
<%@ attribute name="form" rtexprvalue="true" type="java.lang.String" required="false" %>
<%@ attribute name="method" rtexprvalue="true" type="java.lang.String" required="false" %>
<%@ attribute name="action" rtexprvalue="true" type="java.lang.String" required="false" %>
<%@ attribute name="printAction" rtexprvalue="true" type="java.lang.String" required="false" %>
<%@ attribute name="onsubmit" rtexprvalue="true" type="java.lang.String" required="false" %>
<%@ attribute name="onsubmitValidate" rtexprvalue="true" type="java.lang.String" required="false" %>

<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td align="right" nowrap="nowrap">
<c:if test="${showLine eq true}">
    <hr>
</c:if>
<c:if test="${showBack eq true}">
    <button class="inputbut" onclick="history.go(-1); return false;"><bean:message key="command.back"/></button>
</c:if>
<c:if test="${showNew eq true}">
	<button class="inputbut" onclick="location.href='${action}';">
		<bean:message key="command.new" />
	</button>
</c:if>
<c:if test="${showPrint eq true}">
	<button class="inputbut" onclick="openWindow('${printAction}')">
		<bean:message key="command.print" />
	</button>
</c:if>
<c:if test="${empty unlocked || unlocked}">
	<c:if test="${showReset eq true}">
		<button class="inputbut" onclick="document.getElementById('${form}').reset();">
			<bean:message key="command.reset" />
		</button>
	</c:if>
	<c:if test="${showDelete eq true}">
		<button class="inputbut" onclick="if (confirm('Confirma exclus&atilde;o?')) {${onsubmit}; document.getElementById('${form}').method.value = 'delete'; document.getElementById('${form}').submit();}">
			<bean:message key="command.delete" />
		</button>
	</c:if>
	<c:if test="${showSave eq true}">
		<c:if test="${empty method}">
			<input type="submit" class="inputbut" value="&nbsp;&nbsp;<bean:message key="command.save" />&nbsp;&nbsp;" onclick="<c:if test="${not empty onsubmitValidate}">if (${onsubmitValidate}) {</c:if>${onsubmit}; document.getElementById('${form}').method.value = 'save';<c:if test="${not empty onsubmitValidate}">}</c:if>" />&nbsp;
		</c:if>
		<c:if test="${not empty method}">
			<input type="submit" class="inputbut" value="&nbsp;&nbsp;<bean:message key="command.save" />&nbsp;&nbsp;" onclick="<c:if test="${not empty onsubmitValidate}">if (${onsubmitValidate}) {</c:if>${onsubmit}; document.getElementById('${form}').method.value = '${method}';<c:if test="${not empty onsubmitValidate}">}</c:if>" />&nbsp;
		</c:if>
	</c:if>
</c:if>
<c:if test="${showCancel eq true}">
	<button onclick="location.href='index.do'; return false;" class="inputbut">
		<bean:message key="command.cancel"/>
	</button>
</c:if>
</td></tr></table>